//
//  SFNvgViewController.swift
//  SFWeiBo
//
//  Created by 孙凡 on 16/4/8.
//  Copyright © 2016年 Edward. All rights reserved.
//

import UIKit

class SFNvgViewController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()


    }





    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    override func pushViewController(viewController: UIViewController, animated: Bool) {


        if childViewControllers.count > 0{

            viewController.hidesBottomBarWhenPushed = true
        }

        super.pushViewController(viewController, animated: animated)


        if childViewControllers.count == 2 {

            viewController.navigationItem.leftBarButtonItem = UIBarButtonItem(imageName: "navigationbar_back_withtext", title: "返回", target: self, SEL: #selector(SFTempVc.pop))

        }





    }

    func pop(){

        popViewControllerAnimated(true)
    }
}
